using System.Collections.Generic;

using com.tc.zigbee.zcl;
using com.tc.zigbee.zcl.command;
using com.tc.util;
namespace com.tc.zigbee.zcl
{
    public class ReporterConfigurationRecord
    {
        public int fill(byte[] data, int offset)
        {
            int i = offset;
            data[i++] = direction;
            i += DataUtil.bytesValue(attribute, data, i);
            data[i++] = datatype;
            i += DataUtil.bytesValue(minInterval, data, i);
            i += DataUtil.bytesValue(maxInterval, data, i);

            for (int x = 0; x < reportableChange.value.Length; x++)
            {
                data[i++] = reportableChange.value[x++];
            }
            return i - offset;
        }

        public byte[] data()
        {
            byte[] data = new byte[length()];
            fill(data, 0);
            return data;
        }

        public int length()
        {
            return 8 + reportableChange.value.Length;
        }

        public byte direction = 0;
        public short attribute;
        public byte datatype;
        public short minInterval;
        public short maxInterval;
        public DataValue reportableChange;

    }
}